import  React from 'react'



//  state  props
export  default  class  Form  extends  React.Component {

    constructor () {
        super() 
        this.state={
            val:'hello form'
        }
    }

    myChange=(e)=> {
        console.log(e.target)

        this.setState({
            val:e.target.value
        })

    }


    render() {

        return(
            <>
        <div>Form 组件  </div>
        <form action="">
            
            <input type="text"   value={this.state.val}  onInput={this.myChange}/>

            <button>点击提交 </button>

            <div> {this.state.val}</div>

        </form>

        </>
        )
    }
}